package com.sdkj.dspservice.modules.report.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.sdkj.dspservice.common.base.dao.CrudDao;
import com.sdkj.dspservice.modules.report.entity.TableConfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 数据视图dao
 * @author tm
 */
public interface TableConfigDao extends CrudDao<TableConfig> {
    /**
     * 关联查询
     * @param wrapper
     * @return
     */
    @Select({"select a.*,s.name as \"source.name\" from report_table_config a " +
            "left join report_source s on s.id = a.source_id " +
            "${ew.customSqlSegment}"})
    List<TableConfig> listLink(@Param(Constants.WRAPPER) Wrapper<TableConfig> wrapper);
}